package com.tq68.weixin.vo;

import java.util.List;

import com.tq68.weixin.common.AppConstantEnum;
import com.tq68.weixin.model.Bbs;
import com.tq68.weixin.model.Checkin;

/**
 * session中用户的信息
 * @author cqrun
 *
 */
public class UserVO {
	
	private Integer userid;
	//登录用户名
	private String username;
	//昵称
	private String nickname;
	//用户头像
	private String usericon;
	//用户等级数字（1--游客，2—未认证业主，3—认证业主，4--实名认证业主）
	private Integer userlevel;
	//用户等级字符串
	private String userlevelStr;
	//用户等级样式
	private String levelColor;
	//微信关注用户的openid
	private String openid;
	//电话
	private String phone;
	//真实姓名
	private String realname;
	//小区id
	private Integer userCommunityId;
	//小区名称（标准名）
	private String userCommunityName;
	//百度地图上小区的别名（多个名称都为同一个小区），形如：##A小区##AA小区##
	private String communityNameAlias;
	//最后打卡日期
	private String lastCheckinDate;
	//今天是否已打卡
	private boolean isCheckinToday;
	//业主与小区关联表id
	private Integer usercommid;
	//最近n条签到记录
	private List<Checkin> recentlyChecklist;
	//最近n条发帖记录
	private List<Bbs> recentlyBbsList;
	//金币数
	private Integer coins;
	//贡献值
	private Integer cvalue;
	//家乡
	private String homeTown;
	//省
	private String province;
	//市
	private String city;
	//区县
	private String distin;
	//性别，1-男，2-女，0-未知
	private Integer sex;
	//同小区老乡人数
	private Integer sameHometownCount;
	//扫码带过来的商家id
	private Integer selleridFromScan;
	//是否实名
	private Integer isRealName;
	
	public Integer getUserid() {
		return userid;
	}

	public void setUserid(Integer userid) {
		this.userid = userid;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public String getUsericon() {
		return usericon;
	}

	public void setUsericon(String usericon) {
		this.usericon = usericon;
	}

	public Integer getUserlevel() {
		return userlevel;
	}

	public void setUserlevel(Integer userlevel) {
		this.userlevel = userlevel;
	}

	public String getUserlevelStr() {
		return userlevelStr;
	}

	public void setUserlevelStr(String userlevelStr) {
		this.userlevelStr = userlevelStr;
	}

	public String getOpenid() {
		return openid;
	}

	public void setOpenid(String openid) {
		this.openid = openid;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getRealname() {
		return realname;
	}

	public void setRealname(String realname) {
		this.realname = realname;
	}

	public Integer getUserCommunityId() {
		return userCommunityId;
	}

	public void setUserCommunityId(Integer userCommunityId) {
		this.userCommunityId = userCommunityId;
	}

	public String getUserCommunityName() {
		return userCommunityName;
	}

	public void setUserCommunityName(String userCommunityName) {
		this.userCommunityName = userCommunityName;
	}

	public List<Checkin> getRecentlyChecklist() {
		return recentlyChecklist;
	}

	public void setRecentlyChecklist(List<Checkin> recentlyChecklist) {
		this.recentlyChecklist = recentlyChecklist;
	}

	public List<Bbs> getRecentlyBbsList() {
		return recentlyBbsList;
	}

	public void setRecentlyBbsList(List<Bbs> recentlyBbsList) {
		this.recentlyBbsList = recentlyBbsList;
	}

	public String getLastCheckinDate() {
		return lastCheckinDate;
	}

	public void setLastCheckinDate(String lastCheckinDate) {
		this.lastCheckinDate = lastCheckinDate;
	}

	public boolean isCheckinToday() {
		return isCheckinToday;
	}

	public void setCheckinToday(boolean isCheckinToday) {
		this.isCheckinToday = isCheckinToday;
	}

	public Integer getUsercommid() {
		return usercommid;
	}

	public void setUsercommid(Integer usercommid) {
		this.usercommid = usercommid;
	}

	public String getCommunityNameAlias() {
		return communityNameAlias;
	}

	public void setCommunityNameAlias(String communityNameAlias) {
		this.communityNameAlias = communityNameAlias;
	}

	public String getLevelColor() {
		return levelColor;
	}
	
	public void setLevelColor(Integer userlevel){
		if(userlevel>=10 && userlevel<=11){
			levelColor = AppConstantEnum.MASTER;
		}else if(userlevel>=6 && userlevel<=7){
			levelColor = AppConstantEnum.CAPTAIN;
		}else{
			levelColor = AppConstantEnum.NOMAL;
		}
	}

	public Integer getCoins() {
		return coins;
	}

	public void setCoins(Integer coins) {
		this.coins = coins;
	}

	public Integer getCvalue() {
		return cvalue;
	}

	public void setCvalue(Integer cvalue) {
		this.cvalue = cvalue;
	}

	public String getHomeTown() {
		return homeTown;
	}

	public void setHomeTown(String homeTown) {
		this.homeTown = homeTown;
	}

	public Integer getSex() {
		return sex;
	}

	public void setSex(Integer sex) {
		this.sex = sex;
	}

	public Integer getSameHometownCount() {
		return sameHometownCount;
	}

	public void setSameHometownCount(Integer sameHometownCount) {
		this.sameHometownCount = sameHometownCount;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince() {
		String province = homeTown.substring(0, homeTown.indexOf(" "));
		this.province = province;
	}

	public String getCity() {
		return city;
	}

	public void setCity() {
		String city = homeTown.substring(homeTown.indexOf(" ")+1, homeTown.lastIndexOf(" "));
		this.city = city;
	}

	public String getDistin() {
		return distin;
	}

	public void setDistin() {
		String distin = homeTown.substring(homeTown.lastIndexOf(" ")+1);
		this.distin = distin;
	}

	public Integer getSelleridFromScan() {
		return selleridFromScan;
	}

	public void setSelleridFromScan(Integer selleridFromScan) {
		this.selleridFromScan = selleridFromScan;
	}

	public Integer getIsRealName() {
		return isRealName;
	}

	public void setIsRealName(Integer isRealName) {
		this.isRealName = isRealName;
	}

}
